//
//  MainTypesListViewController.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/11.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MainTypesListViewController.h"
#import "MainTypesListViewModel.h"
#import "MianTypeListNextPageViewController.h"

@interface MainTypesListViewController ()
@property (nonatomic, strong) MainTypesListViewModel *viewModel;
@end

@implementation MainTypesListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"主营类型";
    self.viewModel = [[MainTypesListViewModel alloc] initWithViewToViewModel:self.tableView theSuperView:self.view];
    kWeakSelf(self);
    self.viewModel.BlockSelectRow = ^(NSDictionary *dic) {
        [weakself seleRow:dic];
    };
}

- (void)seleRow:(NSDictionary *)dic
{
    MianTypeListNextPageViewController *vc = [MianTypeListNextPageViewController new];
    MainTypesListArrModel *model = dic[@"one"];
    vc.title = model.categoryName;
    kWeakSelf(self);
    vc.BlockBackPage = ^(NSDictionary *dic) {
        weakself.viewModel.dic = [NSDictionary dictionaryWithDictionary:dic];
    };
    vc.dic = [NSMutableDictionary dictionaryWithDictionary:dic];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
